package ren.yugong.fileutil;

import java.lang.reflect.Method;

public class MethodInfo implements Comparable<MethodInfo> {

    private String name;

    private Method method;

    private int order;

    private String format;
    private int length;
    private int multiple;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    @Override
    public int compareTo(MethodInfo info) {
        if (this.order < info.order) {
            return -1;
        } else if (this.order > info.order) {
            return 1;
        } else {
            throw new TemplateColumnOrderEqualsException("template column order is equals!!");
        }
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getLength() {
        return length;
    }

    public void setMultiple(int multiple) {
        this.multiple = multiple;
    }

    public int getMultiple() {
        return multiple;
    }
}
